package com.example.boottest.controller;

import com.example.boottest.service.UserDao;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author TonySong
 * @date 2024/4/22 0022
 * @time 15:30
 */
@RestController
@Slf4j
public class UserController {

    @Resource //根据名称
//    @Autowired //根据类型
    private UserDao  userDaoImpl;//--->UserDaoImpl
    //此时的userDao的实例： userDaoImpl  userDaoMysql??


    @GetMapping("/test")
    public String test() {
         this.userDaoImpl.list();
        return "控制器的输出";
    }
}
